package leetcode.每日一题;

import org.junit.Test;

import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.AbstractQueuedLongSynchronizer;

/**
 * @author :songyaozhang
 * @date :Created 2021/7/14 8:31
 * @description :https://leetcode-cn.com/problems/minimum-absolute-sum-difference/
 */


public class 绝对差值和 {
    @Test
    public void test() {
        Solution solution = new Solution();
        System.out.println(solution.minAbsoluteSumDiff(new int[]{1, 28, 21}, new int[]{9, 21, 20}));
        Object o = new Object();
        o.hashCode();
        Integer a = 3;
        Integer b = 3;
        System.out.println(a == b);
        Queue<String> queue = new LinkedList<>();
    }

    class Solution {
        public int minAbsoluteSumDiff(int[] nums1, int[] nums2) {
            final int MOD = 100000007;
            int len = nums1.length;
            int[] rec = Arrays.copyOf(nums1, len);
            int sum = 0, maxn = 0;
            for (int i = 0; i < len; i++) {
                int diff = Math.abs(nums1[i] - nums2[i]);
                sum = (sum + diff) % MOD;
                int j = binarySearch(rec, nums1[i]);
            }
            return 0;
        }

        private int binarySearch(int[] nums, int tar) {
            int l = 0;
            int r = nums.length;
            int mid;
            while (l < r) {
                mid = l + r >> 1;
                if (nums[mid] < tar) {
                    l = mid + 1;
                } else {
                    r = mid;
                }
            }
            int left = l;
            //if (nums[left] > tar)
            return 1;
        }
    }

}





